package com.inifitness.common.basic;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;

import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * 实体基础类.
 *
 * @author sunjinfeng
 * @version 1.0.0
 * @since 2024/04/18 11:00:00
 */
@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.NONE)
public class BaseEntity implements Serializable {

  @Serial
  private static final long serialVersionUID = 9096508438272810594L;

  @TableField(fill = FieldFill.INSERT)
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime createTime;

  @TableField(fill = FieldFill.INSERT_UPDATE)
  @JsonInclude(JsonInclude.Include.NON_NULL)
  @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
  private LocalDateTime updateTime;
}